const path = '/institute'
// 研究院导航栏数据设置
export const navList = [
    {
        name: '首页',
        route: '/institute',
        sign: 'index'
    },
    {
        name: '商务对接',
        sign: 'swdj',
        node: [
            {
                cid: 58,
                name: '项目对接',
                type: 'd'
            },
            {
                name: '资质对接',
                route: '/institute/qualification'
            },
            {
                name: '证书对接',
                route: '/institute/certificate'
            }
        ]
    },
    {
        name: '工程服务',
        sign: 'gcfw',
        node: [
            {
                cid: 58,
                name: '设计服务',
                type: 's'
            },
            {
                cid: 66,
                name: '工程咨询',
                type: 's'
            },
            {
                cid: 65,
                name: 'BIM服务',
                type: 's'
            }
        ]
    },
    {
        name: '研发合作',
        sign: 'yfhz',
        node: [
            // {
            //     name: '标准服务',
            //     route: '/institute/standard'
            // },
            {
                cid: 111,
                name: '课题服务',
                type: 's'
            },
            {
                cid: 112,
                name: '专项技术',
                type: 's'
            },
            {
                cid: 113,
                name: '定制化研发',
                type: 's'
            },
            {
                cid: 114,
                name: '平台实验室',
                type: 's'
            }
        ]
    },
    {
        name: '专家库',
        route: '/institute/expert',
        sign: 'expert'
    }
]
// 解析路由
export const parseRoute = (item: any) => {
    return item.route || `${path}/${item.type}/${item.cid}`
}
// 生成路由键对值
export const parseRouteKey = (store: any) => {
    const nav = navList
    const json: any = {}
    nav.forEach((item: any) => {
        json[parseRoute(item)] = {
            s: item.sign,
            tn: item.name,
            cn: item.name
        }
        if (item.node && item.node.length > 0) {
            item.node.forEach((ite: any) => {
                json[parseRoute(ite)] = {
                    s: item.sign,
                    tn: item.name,
                    cn: ite.name
                }
            })
        }
    })
    store.commit('setInstitute', json)
    return json
}
// 列表参数
export interface ParmsInfo {
    classId: string
    sort: string
    sortValue: string
    area?: string | [string, string]
    keyWord?: string
}
